package com.icart.context.provider;

import com.icart.context.HttpUserContext;
import com.icart.context.HttpUserContextImpl;
import com.icart.context.SaleUserContext;
import com.icart.context.SaleUserContextImpl;
import com.icart.repositories.CustinfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by kim on 17/11/20.
 */

public class UserContextProvider {

    public static synchronized HttpUserContext create(Long custid,String custname){

        HttpUserContext context=new HttpUserContextImpl();

        context.setCustid(custid);
        context.setCustname(custname);

        return context;

    }

    public static synchronized SaleUserContext createsale(Long staffid,String username,Long chnid){

        SaleUserContext context=new SaleUserContextImpl();

        context.setStaffid(staffid);
        context.setChnid(chnid);
        context.setUsername(username);


        return context;

    }

}
